<?php

namespace App\Http\Controllers;

use Laravel\Lumen\Routing\Controller as BaseController;
use App\Traits\ResponseApi;
use Tymon\JWTAuth\Facades\JWTAuth;

class Controller extends BaseController
{
    use ResponseApi;

    public static function getUid()
    {
        $user = JWTAuth::parseToken()->authenticate();
        return $user->id;
    }

    public static function getUname()
    {
        $user = JWTAuth::parseToken()->authenticate();
        return $user->username;
    }
}
